﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Cloud.Core.Response
{
    public class JsonResponse
    {
        /// <summary>
        /// 返回消息 
        /// </summary>
        public string Msg { get; set; }


       
        /// <summary>
        /// 返回状态 
        /// </summary>
        public ResponseStatus Status { get; set; }

        /// <summary>
        /// 返回消息 
        /// </summary>
        public string Remark { get; set; }

    }

    public class JsonResponse<T> : JsonResponse
    {
        /// <summary>
        /// 返回数据 
        /// </summary>
        public T Data { get; set; }
    }


    public class JsonLoginResponse<T> : JsonResponse
    {
        public string accessToken { get; set; }
        /// <summary>
        /// 返回数据 
        /// </summary>
        public T Data { get; set; }
    }

    /// <summary>
    /// 返回状态 
    /// </summary>
    public enum ResponseStatus
    {
        /// <summary>
        /// 成功 
        /// </summary>
        Success = 0,

        /// <summary>
        /// 请求失败 
        /// </summary>
        RequestError = 1,

        /// <summary>
        /// 验证失败 
        /// </summary>
        AuthFail = 2,

        /// <summary>
        /// 处理失败 
        /// </summary>
        ProcessFail = 3,

        /// <summary>
        /// 参数错误 
        /// </summary>
        ParameterError = 4,

        /// <summary>
        /// 无此数据 
        /// </summary>
        NullData = 5,

        /// <summary>
        /// 数据一对多
        /// </summary>
        MultipleData = 6,

        /// <summary>
        /// 权限错误
        /// </summary>
        PowerError,
    }
}
